#ifndef _RENDER_MESH_H_
#define _RENDER_MESH_H_

#include "Renderer.h"
#include "VertKinds.h"

// Vertex declarations possibly used by this mesh
extern IDirect3DVertexDeclaration9* g_VertPosClr;
extern IDirect3DVertexDeclaration9* g_VertPosTex;

class RenderMesh
{
	friend class MeshManager;

	// Pointer to vertex buffer
	IDirect3DVertexBuffer9* m_pVertexBuff;
	// Pointer to index buffer
	IDirect3DIndexBuffer9* m_pIndexBuff;
	// Pointer to vertex declaration used by shader
	IDirect3DVertexDeclaration9* m_pVertexDecl;
	// Size (in bytes) of a vertex for this mesh
	UINT m_uiVertSize;
	// Number of vertices in this mesh
	UINT m_uiNumVerts;
	// Number of primitives (triangles) in this mesh
	UINT m_uiPrimCount;

	// For test purposes, we might want to just make a hardcoded cube...
	void MakeCube(void);

	// This will set the vertex declaration and stream sources for the renderer to render this mesh
	void Render(void);

public:
	// Default Constructor - Initialize data members to safe values
	RenderMesh(void);

	// Function used to load the mesh from a file
	void Load(const char* filename);

};


#endif // _RENDER_MESH_H_